package jdklearning.rmi;


import java.net.MalformedURLException;
import java.rmi.AlreadyBoundException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;



public class RmiServer {

	public static void main(String[] args) {
		try {
//			Registry registry = LocateRegistry.createRegistry(8999);
//			registry.bind("aaa", new TestInterface() {
//				
//				@Override
//				public String aaa() throws RemoteException {
//					return "aaa";
//				}
//			});
			TestInterface testInterface = new TestInterfaceImpl();
			LocateRegistry.createRegistry(12312);
			Naming.bind("rmi://192.168.1.70:12312/testInterface", testInterface);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (AlreadyBoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
